﻿using System.Collections.Generic;
using System.Threading.Tasks;
using BCEntity.OA.Attendance.AttendanceRemedyApply;
using BCEntity.OA.TeamWorks.TaskRecord;
using BCEntity.OA.Workflow.WorkflowActivityInstanceReference;

namespace BCData.OA.TeamWorks.AttendanceTaskRecord
{
    public interface IAttendanceTaskRecordData
    {

        /// <summary>
        /// 新增一组任务列表
        /// </summary>
        /// <param name="remedyApplyEntity">补卡申请信息</param>
        /// <param name="entities">任务列表</param>
        /// <param name="receiverEntities">任务抄送人信息</param>
        /// <param name="referenceEntity">任务相关业务</param>
        /// <param name="remedyApplyEntity">考勤补卡申请信息</param>
        /// <returns></returns>
        Task<IEnumerable<TaskRecordEntity>> InsertListAsync(AttendanceRemedyApplyEntity remedyApplyEntity, List<TaskRecordEntity> entities, List<TaskReceiverRecordEntity> receiverEntities = null, WorkflowActivityInstanceReferenceEntity referenceEntity = null);

        /// <summary>
        /// 根据任务单号获取任务信息
        /// </summary>
        /// <param name="taskRecordNo"></param>
        /// <returns></returns>
        Task<TaskRecordEntity> GetByTaskRecordNo(string taskRecordNo);
        /// <summary>
        /// 关闭考勤任务单
        /// </summary>
        /// <param name="taskRecordNo"></param>
        Task<bool> Close(string taskRecordNo);
        /// <summary>
        /// 通过考勤任务单
        /// </summary>
        /// <param name="taskRecordNo"></param>
        Task<bool> Pass(string taskRecordNo);

        /// <summary>
        /// 暂停考勤任务单
        /// </summary>
        /// <param name="taskRecordNo"></param>
        /// <param name="pauseRemark">暂停备注</param>
        Task<bool> Paused(string taskRecordNo, string pauseRemark);

        /// <summary>
        /// 驳回考勤任务单
        /// </summary>
        /// <param name="taskRecordNo"></param>
        /// <param name="entity">驳回信息</param>
        Task<bool> Reject(string taskRecordNo, TaskRejectRecordEntity entity);

        /// <summary>
        /// 根据步骤和工作流活动实例Id获取任务单信息
        /// </summary>
        /// <param name="workflowActivityInstanceId">工作流活动实例Id</param>
        /// <param name="currentlyStep">当前步骤</param>
        /// <returns></returns>
        Task<TaskRecordEntity> GetByTaskStepAndWorkflowActivityInstanceId(long workflowActivityInstanceId, int currentlyStep);

        /// <summary>
        /// 根据关联业务单号和执行人查询任务信息
        /// </summary>
        /// <param name="referenceNo">关联业务单号</param>
        /// <param name="adminId"></param>
        /// <returns></returns>
        Task<TaskRecordEntity> GetByReferenceNoAndTaskExecuterAdminId(string referenceNo, long adminId);

    }
}
